/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.ControlEscolar.Validations;



import com.ControlEscolar.Beans.Subject;
import com.ControlEscolar.DAOs.DAOException;
import com.ControlEscolar.DAOs.ReticleDAO;
import com.ControlEscolar.DAOs.SubjectDAO;
import java.util.ArrayList;

/**
 *
 * @author Rodna Marrufo
 */
public class ValidationsSubject extends BasicValidation{
    SubjectDAO subjectDAO=new SubjectDAO();
    ReticleDAO reticleDAO=new ReticleDAO();

    public boolean isExistSubject(String subjectKey) throws DAOException{
        Subject searchSubject= subjectDAO.queryByKey(subjectKey);
         return isFound(searchSubject);
    }

    public boolean isSubjectInReticle(String subjectKey) throws DAOException{
        ArrayList searchSubjectInReticle= reticleDAO.queryBySubjectKey(subjectKey);
       return isFound(searchSubjectInReticle);
         

    }
}
